package com.dq.eduservice.service;

import com.dq.eduservice.entity.EduChapter;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dq.eduservice.vo.chapter.ChapterVo;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 课程(EduChapter)表服务接口
 *
 * @author Dq
 * @since 2022-07-22 19:50:35
 */
@Transactional
public interface EduChapterService  extends IService<EduChapter> {

    /**
     * 根据课程Id查询章节小节
     * @param courseId
     * @return
     */
    List<ChapterVo> getChapterAndVideoByCourseId(String courseId);

    /**
     * 添加章节
     * @param chapterVo
     */
    void addChapter(EduChapter chapterVo);

    /**
     * 根据章节id查询章节和具体小节
     * @param chapterId
     * @return
     */
    ChapterVo getChapterById(String chapterId);

    /**
     * 修改章节对象
     * @param eduChapter
     */
    void updateChapterInfo(EduChapter eduChapter);

    /**
     * 根据章节id删除章节小节
     * @param chapterId
     */
    void deleteChapterInfoAndVideoById(String chapterId);

    /**
     * 根据课程id删除章节
     * @param courseId
     */
    void deleteChapterByCourseId(String courseId);
}